using System.Collections;
using System.Collections.Generic;
using Main.Details;
using Main.Event;
using UnityEngine;
namespace Main.NPC
{
    public class NPCFunction : MonoBehaviour
    {
        public InventoryBag_SO shopData;
        private bool isOpen;

        private void Update()
        {
            if (isOpen && Input.GetKeyDown(KeyCode.Escape))
            {
                CloseShop();
            }
        }

        public void OpenShop()
        {
            isOpen = true;
            MainEventSystem.CallUpdateGameStateEvent(GameState.Pause);
            MainEventSystem.CallBaseBagOpenEvent(SlotType.Shop, shopData);
        }

        public void CloseShop()
        {
            isOpen = false;
            MainEventSystem.CallUpdateGameStateEvent(GameState.GamePlay);
            MainEventSystem.CallBaseBagCloseEvent(SlotType.Shop, shopData);
        }
    }
}